#include "CustomException.h"

namespace util {
    namespace exception{

        void BaseException::w_what(unique_ptr<WSTR_STRUCT>* pupwstr) const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_NOTHROW{
            WSTR_STRUCT * temp = pupwstr->release();     
            if(temp != nullptr){
                delete temp;
            }
            pupwstr->reset(new WSTR_STRUCT(this->what()));
        }

        CustomException::CustomException(const char* str){
            msg = str;
        }

        const char* CustomException::what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_NOTHROW{
            return msg;
        }

        UnexpectedException::UnexpectedException(const char * msg) : CustomException(msg){}
    }
}